import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop021_添加品牌"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品品牌')
# 添加
firefox.find_element_by_link_text("添加品牌").click()
firefox.find_element_by_id("brand_name").send_keys("苹果")
firefox.find_element_by_xpath("//button[text()=' 保存品牌']").click()
# 断言
n = "苹果"
s = firefox.find_element_by_xpath\
    ("//td[contains(.,'%s')]/following-sibling::td[3]/input"%n).get_property("value")
print(s)
if  s=="255":
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()

